import request from '@/utils/request'

export function modelers(data) {
  return request({
    url: 'workflow/cmd/v1/definition',
    method: 'post',
    data
  })
}

export function saveOrUpdate(data) {
  return request({
    url: 'workflow/cmd/v1/definition',
    method: 'put',
    data
  })
}

export function get(id) {
  return request({
    url: 'workflow/cmd/v1/definition/' + id,
    method: 'get'
  })
}

export function del(data) {
  return request({
    url: 'workflow/cmd/v1/definition',
    method: 'delete',
    data
  })
}

export function gethighLine(instanceId) {
  return request({
    url: 'workflow/cmd/v1/history/' + instanceId,
    method: 'get'
  })
}

export function updateState(data) {
  return request({
    url: 'workflow/cmd/v1/definition/updateState',
    method: 'post',
    data
  })
}

export function getDefinitions(id) {
  return request({
    url: 'workflow/cmd/v1/definition/getDefinitions/' + id,
    method: 'get'
  })
}
